# send random data to the channel created bymyself on thingspeak

import urllib
import urllib2
import random
import time

getfeedurl = "http://api.thingspeak.com/channels/16960/feed.json"
updateurl = "http://api.thingspeak.com/update"

while 1:
	intdata = random.randint(1,100)
	print "random data:" + str(intdata)

	para = urllib.urlencode({'api_key':'9T9GQVEVL9TVALII','field1':intdata})
	resp = urllib2.urlopen(updateurl,para)
	ret = resp.read()
	print "return:" + ret
	print
	time.sleep(14)

print
print
raw_input("enter:")
sys.exit()
